package com.ruoyi.bantong.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bantong.mapper.BtUserLevelMapper;
import com.ruoyi.bantong.domain.BtUserLevel;
import com.ruoyi.bantong.service.IBtUserLevelService;

/**
 * 用户等级Service业务层处理
 * 
 * @author laohei
 * @date 2021-01-24
 */
@Service
public class BtUserLevelServiceImpl implements IBtUserLevelService 
{
    @Autowired
    private BtUserLevelMapper btUserLevelMapper;

    /**
     * 查询用户等级
     * 
     * @param level 用户等级ID
     * @return 用户等级
     */
    @Override
    public BtUserLevel selectBtUserLevelById(Integer level)
    {
        return btUserLevelMapper.selectBtUserLevelById(level);
    }

    /**
     * 查询用户等级列表
     * 
     * @param btUserLevel 用户等级
     * @return 用户等级
     */
    @Override
    public List<BtUserLevel> selectBtUserLevelList(BtUserLevel btUserLevel)
    {
        return btUserLevelMapper.selectBtUserLevelList(btUserLevel);
    }

    /**
     * 新增用户等级
     * 
     * @param btUserLevel 用户等级
     * @return 结果
     */
    @Override
    public int insertBtUserLevel(BtUserLevel btUserLevel)
    {
        btUserLevel.setCreateTime(DateUtils.getNowDate());
        return btUserLevelMapper.insertBtUserLevel(btUserLevel);
    }

    /**
     * 修改用户等级
     * 
     * @param btUserLevel 用户等级
     * @return 结果
     */
    @Override
    public int updateBtUserLevel(BtUserLevel btUserLevel)
    {
        btUserLevel.setUpdateTime(DateUtils.getNowDate());
        return btUserLevelMapper.updateBtUserLevel(btUserLevel);
    }

    /**
     * 批量删除用户等级
     * 
     * @param levelIds 需要删除的用户等级ID
     * @return 结果
     */
    @Override
    public int deleteBtUserLevelByIds(Integer[] levelIds)
    {
        return btUserLevelMapper.deleteBtUserLevelByIds(levelIds);
    }

    /**
     * 删除用户等级信息
     * 
     * @param levelId 用户等级ID
     * @return 结果
     */
    @Override
    public int deleteBtUserLevelById(Integer levelId)
    {
        return btUserLevelMapper.deleteBtUserLevelById(levelId);
    }
}
